import { NFont, NConfig } from '../types';
import { deepClone } from './deep-clone';
export function createFont(font: Partial<NFont.IFont> = {}): NFont.IFont {
    return Object.assign({
        size: 12,
        family: '微软雅黑',
        color: '#000000',
        weight: NFont.EFontWeight.normal,
        lineHeight: 2,
        decoration: NFont.EDecoration.none,
        style: NFont.EFontStyle.normal,
        horizontally: NFont.EHorizontally.left,
        vertical: NFont.EVertical.bottom,
        autoWrap: false,
        letterSpace: 1
    }, font);
}
export function createHeaderFont() {
    return createFont({
        size: 12,
        family: '微软雅黑',
        color: '#5C5C5C',
        weight: NFont.EFontWeight.normal,
        lineHeight: 2,
        decoration: NFont.EDecoration.none,
        style: NFont.EFontStyle.normal,
        horizontally: NFont.EHorizontally.center,
        vertical: NFont.EVertical.middle,
        letterSpace: 1
    });
}
export function createCellFont(font: Partial<NFont.IFont> = {}) {
    return Object.assign({
        size: 12,
        family: '微软雅黑',
        color: '#000000',
        weight: NFont.EFontWeight.normal,
        lineHeight: 7,
        decoration: NFont.EDecoration.none,
        style: NFont.EFontStyle.normal,
        horizontally: NFont.EHorizontally.left,
        vertical: NFont.EVertical.bottom,
        autoWrap: false,
        letterSpace: 1
    }, font);
}
export function createConfig(params:any) {
    
}
export function createDefaultConfig(conf: Partial<NConfig.IConfig> = {}, pixelRatio = 1): NConfig.IConfig {
    let defaultValue: NConfig.IConfig = {
        common: {
            font: {
                size: 12,
                family: '微软雅黑',
                horizontally: NFont.EHorizontally.left,
                vertical: NFont.EVertical.middle,
                color: '#000000',
                weight: 400,
                lineHeight: 2,
                decoration: NFont.EDecoration.none,
                style: NFont.EFontStyle.normal,
                autoWrap: false,
                letterSpace: 1
            },
            fill: {

            }
        },
        header: {
            row: {
                font: createCellFont(),
                // height: 20 * pixelRatio,
                height: 30 * pixelRatio,
                width: 40 * pixelRatio,
                fill: {
                    background: {
                        color: '#e9ecef'
                    }
                }
            },
            col: {
                font: createCellFont(),
                height: 25 * pixelRatio,
                // width: 60 * pixelRatio,
                width: 80 * pixelRatio,
                fill: {
                    background: {
                        color: '#e9ecef'
                    }
                }
            }
        },
        view: {
            // row: 25,
            // col: 150
            row: 0,
            col: 0
        }
    };
    return deepClone(defaultValue, conf);
}